package rule01.jdbc.mysql;

import rule01.jdbc.Connection;
import rule01.jdbc.Driver;
import rule01.jdbc.DriverManager;

/**
 * @author ChangLiang
 * @date 2020/3/16
 */
public class MysqlDriver implements Driver {

    static{
        DriverManager.registerDriver(new MysqlDriver());
    }

    @Override
    public Connection getConnection(String url, String username, String password) {
        if (url.contains("mysql")) {
            return new MysqlConnection();
        }
        return null;
    }
}
